import request from '@/utils/request'

/**
 * 获取项目列表
 * @param data
 * @returns {*}
 */
export const getProjectListApi = (data) => {
  return request({
    url: '/busi/GetProjectList',
    method: 'post',
    data
  })
}

/**
 *
 * @param data
 * @returns {*}
 */
export const createOrUpdateProjectApi = (data) => {
  return request({
    url: '/busi/CreateOrUpdateProject',
    method: 'post',
    data
  })
}

/**
 *
 * @param data
 * @returns {*}
 */
export const setProjectStatusApi = (data) => {
  return request({
    url: '/busi/SetProjectStatus',
    method: 'post',
    data
  })
}

/**
 *
 * @param data
 * @returns {*}
 */
export const getProjectOpenStatusApi = (data) => {
  return request({
    url: '/busi/GetProjectOpenStatus',
    method: 'post',
    data
  })
}

/**
 *
 * @param data
 * @returns {*}
 */
export const setProjectOpenStatusApi = (data) => {
  return request({
    url: '/busi/SetProjectOpenStatus',
    method: 'post',
    data
  })
}

/**
 *
 * @param data
 * @returns {*}
 */
export const getSheetListApi = (data) => {
  return request({
    url: '/busi/GetSheetList',
    method: 'post',
    data
  })
}

/**
 *
 * @param data
 * @returns {*}
 */
export const updateSheetConfigApi = (data) => {
  return request({
    url: '/busi/UpdateSheetConfig',
    method: 'post',
    data
  })
}

/**
 *
 * @param data
 * @returns {*}
 */
export const deleteSheetModelApi = (data) => {
  return request({
    url: '/busi/DeleteSheetModel',
    method: 'post',
    data
  })
}

/**
 *
 * @param data
 * @returns {*}
 */
export const useOldSheetModelApi = (data) => {
  return request({
    url: '/busi/UseOldSheetModel',
    method: 'post',
    data
  })
}
/**
 *
 * @param data
 * @returns {*}
 */
export const getFillProgressApi = (data) => {
  return request({
    url: '/busi/GetFillProgress',
    method: 'post',
    data
  })
}

/**
 *
 * @param data
 * @returns {*}
 */
export const createCopySheetsForDepartmentApi = (data) => {
  return request({
    url: '/busi/CreateCopySheetsForDepartment',
    method: 'post',
    data
  })
}

/**
 * 上传模板
 * @param data
 * @param params
 * @returns {*}
 */
export const uploadSheetModelApi = (data, params) => {
  return request({
    url: '/busi/UploadSheetModel',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data;charset=UTF-8'
    },
    params,
    data
  })
}

/**
 * 下载模板
 * @param params
 * @returns {*}
 */
export const downloadSheetModelApi = (params) => {
  return request({
    url: '/busi/DownloadSheetModel',
    method: 'get',
    responseType: 'blob',
    params
  })
}
/**
 * 下载填报表单
 * @param params
 * @returns {*}
 */
export const downloadSheetApi = (params) => {
  return request({
    url: '/busi/DownloadSheet',
    method: 'get',
    responseType: 'blob',
    params
  })
}

/**
 * 获取填报清单
 * @param data
 * @returns {*}
 */
export const getProjectFileDataListOfDepartmentApi = (data) => {
  return request({
    url: '/busi/GetProjectFileDataListOfDepartment',
    method: 'post',
    data
  })
}

/**
 * 重置所有模板
 * @param data
 * @returns {*}
 */
export const reFillAllSheetApi = (data) => {
  return request({
    url: '/busi/ReFillAllSheet',
    method: 'post',
    data
  })
}
/**
 * 重置单个模板
 * @param data
 * @returns {*}
 */
export const reFillSheetApi = (data) => {
  return request({
    url: '/busi/ReFillSheet',
    method: 'post',
    data
  })
}
/**
 * 完成填报
 * @param data
 * @returns {*}
 */
export const finishFillSheetApi = (data) => {
  return request({
    url: '/busi/FinishFillSheet',
    method: 'post',
    data
  })
}

/**
 *
 * @param params
 * @returns {*}
 */
export const summaryProjectDataAndDownloadApi = (params) => {
  return request({
    url: '/busi/SummaryProjectDataAndDownload',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
